import Router from 'vue-router'
import { Component, Emit, Inject, Model, Prop, Provide, Vue, Watch } from 'vue-property-decorator'
import jQuery from 'jquery'
import TcHeader from '@/controls/TcHeader.vue'
import TcCard from '@/controls/TcCard.vue'
import TcIcon from '@/controls/TcIcon.vue'
import TcScrollView from '@/controls/TcScrollView.vue'

const decline = { color: '#25D282', icon: 'down-arrow' }
const rise = { color: '#FB4B55', icon: 'up-arrow' } // 升
const unchange = { color: '#464646', icon: '' }

@Component({
  components: {
    TcScrollView,
    TcHeader,
    TcCard,
    TcIcon
  }
})
export default class QuotesPage extends Vue {
  title = '行情'
  height = '100%'
  status = { name: '开盘', time: '2017/12/25 17:30:00' }
  leftIcons = [ { icon: 'headset', tag: 'customer-service', name: '', color: '#D5AC73' } ]
  rightIcons = [ { icon: '', tag: 'open-account', name: '开户', color: '#D5AC73' } ]

  list = [
    {
      title: { name: '点金黄金', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise }
    },
    {
      title: { name: '上海金9999', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: unchange },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: unchange }
    },
    {
      title: { name: '伦敦金', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise }
    },
    {
      title: { name: '港金', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise }
    },
    {
      title: { name: '点金白银', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: decline },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: decline }
    },
    {
      title: { name: '伦敦银', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: decline },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: decline }
    },
    {
      title: { name: '点金铂金', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise }
    },
    {
      title: { name: '铂金', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise }
    },
    {
      title: { name: '钯金', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise }
    },
    {
      title: { name: '美元', max: '276.89', min: '274.71' },
      sell: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise },
      buy: { title: '267', suffix: '.03', value: '+0.09 / +0.57%', status: rise }
    }
  ]

  mounted () {
    this.height = window.innerHeight + 'px'
    if (window.cordova) {
      jQuery('.quotes-status').css('padding-top', '20px')
      jQuery('.quotes-list').css('padding-top', '20px')
    }
  }
}
